{$MODE OBJFPC}

type time = record
     h:0..23;
     m,s:0..59;
end;

var a,b:time;

operator <(a,b:time):boolean;
begin
result:=(a.h*3600+a.m*60+a.s)<(b.h*3600+b.m*60+b.s);
end;

begin
read(a.h,a.m,a.s);
read(b.h,b.m,b.s);
write(a<b);
end.  